public class PC {
    private CPU cpu;
    private HardDisk HD;

    public void setCPU(CPU cpu) {
        this.cpu = cpu;
    }

    public void setHardDisk(HardDisk HD) {
        this.HD = HD;
    }

    public void show() {
        System.out.println("CPU速度: " + cpu.getSpeed() + " MHz");
        System.out.println("硬盘容量: " + HD.getAmount() + " GB");
    }
}
